In moving picture coding processing, information is generally compressed utilizing spatial and temporal redundancy included in a moving picture. Usually, transformation into the frequency domain is used as a method of utilizing spatial redundancy, while inter picture prediction coding is used as a method of utilizing temporal redundancy.
In the H.263 moving picture coding method, a mode using arithmetic coding is employed as a variable length coding method (For example, refer to “ITU-T Recommendation H.263: “Video Coding for Low Bit Rate Communication” (1998), Annex E”).
In such variable length coding method, frequency transformation is performed on each block sized 4×4 pixels, and quantization is further performed on such block to generate coefficient values. Then, scanning is performed starting at a high frequency component toward lower frequency components (direct current components), and combinations of a number R indicating a run of “zeros” and a coefficient value L subsequent to it are generated. Subsequently, after converting (binarizing) numbers R, the absolute values of coefficient values L, and the signs of the coefficient values L into binary data made up of “0”s and “1”s by the use of a binary table, binary arithmetic coding is performed on such binary data by switching between a plurality of probability tables for use. A table shown in FIG. 1 is used, for example, as a binary table for the absolute values of the coefficient values L.
FIG. 1 is a table diagram showing an example binary table.
When binarization is performed on the absolute value “2” of a coefficient value L using the binary table shown in FIG. 1, for example, such absolute value is converted into binary data “01”. Also, when performing binarization on the absolute value “3” of a coefficient value L, such absolute value is converted into binary data “001”.
When arithmetic coding is performed on binary data derived from the absolute value of a coefficient value L, a probability table is switched to another one based on a transition diagram shown in FIG. 2, depending on the absolute value of the previous coefficient value L.
FIG. 2 is a transition diagram showing a method of switching between probability tables according to an existing technique.
First, arithmetic coding is performed on the absolute value of the first coefficient value L, using a probability table 1. For the subsequent coefficient values L, a probability table is switched to another one depending on the previous coefficient value L of each of such coefficient values L. More specifically, a probability table 2 is used when the absolute value of the previous coefficient value L is 1, a probability table 3 is used when the absolute value of the previous coefficient value L is 2, and a probability table 4 is used when the absolute value of the previous coefficient value L is 3 or a larger value.
In this case, a determination on a probability table depends entirely on the absolute value of the previous coefficient value L.
Also, each of the probability tables itself is updated depending on whether binary data inputted is “0” or “1”. In this case, each update is performed in a manner in which the probability of “0” is increased when input binary data is “0” and the probability of “1” is increased when input binary data is “1”. Accordingly, adaptations are made on the probability tables so that they will suit the frequency at which binary data is inputted.
In the above existing technique, a probability table is switched to another one depending on the absolute value of the previous coefficient value L. Generally, the absolute values of coefficients on which frequency transformation has been performed tend to be larger in the direction from higher frequency components toward lower frequency components. Thus, there is a problem with the use of the aforementioned existing technique that the switching of a probability table cannot support an increase trend of coefficients in a case where the absolute value of a certain coefficient is smaller than that of the previous coefficient, leading to reduced coding efficiency.
In view of the above problem, it is an object of the present invention to provide a variable length coding method and a variable length decoding method that provide an increased coding efficiency at the time of performing picture coding.